package com.xxs.controller.admin;

import com.jfinal.core.Controller;
import com.xxs.model.Resource;

/**
 * Created with IntelliJ IDEA.
 */
//@Before(AdminInterceptor.class)
public class ResourceController extends Controller {

    public void list(){
//    	setAttr("resourceList", Resource.dao.findByParentId(0));
    	setAttr("resourceList", Resource.dao.findAllList());
    	render("/admin/resource/list.ftl");
    }
    public void edit(){
    	Resource bean = Resource.dao.findById(getParaToInt(0));
    	setAttr("bean", bean);
    	render("/admin/resource/edit.ftl");
    }
    public void add(){
    	render("/admin/resource/add.ftl");
    }
    public void save(){
    	getModel(Resource.class).save();
    	list();
    }
    public void update(){
    	getModel(Resource.class).myUpdate();
        list();
    }
}
